home *** CD-ROM | disk | FTP | other *** search
- Path: fsgi01.fnal.gov!not-for-mail
- From: b91926@fsgi01.fnal.gov (David Sachs)
- Newsgroups: comp.lang.c++
- Subject: Re: dynamic_cast costs?
- Date: 1 Mar 1996 15:23:03 -0600
- Organization: FERMILAB, Batavia, IL
- Message-ID: <4h7prn$666@fsgi01.fnal.gov>
- References: <4h79hl$7lc@news.halcyon.com>
- Reply-To: sachs@fnal.fnal.gov
- NNTP-Posting-Host: fsgi01.fnal.gov
- X-Newsreader: NN version 6.5.0 #9 (NOV)
-
- normanb@halcyon.com (Norm Bryar) writes:
-
- ...
- > Lastly, in MSVC4, I erroneously tried getting from B1 to B2 without an
- >intermediate dynamic_cast to D in the following hierarchy:
-
- > class D : public B1, public B2.
-
- >It threw an access violation and then a "MS C++ Exception." I thought
- >it was just supposed to return NULL if it couldn't make the cast.
-
- I assume you mean that you tried to cast a B1* to a B2*, where the
- object pointed to is actually a D, and B1 has at least one virtual
- function.
-
- In that case, you have encountered a compilaer limitation or bug. BCC
- handles such a dynamic cast properly. Such a dynamic cast is in accordance
- with the draft C++ standard.
- --
- ***** Listen Americans, the IRS is your taxer, the IRS is one. *****
- David Sachs - Fermilab, HPPC MS369 - P. O. Box 500 - Batavia, IL 60510
- Voice: 1 708 840 3942 Deparment Fax: 1 708 840 3785
-